package cutetd.dao;

import java.util.List;
import cutetd.model.M_Navi;
import cutetd.db.GaeDbBase;

public class NaviDao extends GaeDbBase {
	public void saveOrUpdate(M_Navi navi) {
		super.saveOrUpdate(navi);
	}

	public boolean delete(String key) {
		M_Navi t = (M_Navi) super.getObjectByKey(M_Navi.class, key);
		delete(t);
		return true;
	}
	
	/**得到所有导航并按升序返回
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<M_Navi> getListAll() {
		return (List<M_Navi>) super.getListAllByOrder(M_Navi.class, "sort", "asc");
	}

	/**得到所有可见导航
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<M_Navi> getVisibleList() {
		return (List<M_Navi>)super.getListWhereOrderBy(M_Navi.class, "boolDisplay == true", "sort asc");
	}
}
